package com.focus.wecenter.dao.impl;

import com.focus.wecenter.dao.QuestionDao;
import com.focus.wecenter.pojo.Question;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 问题数据库操作实现
 *
 * @author Lv Jing
 * @date 2018年01月06日 14:17
 */
@Repository
public class QuestionDaoImpl extends BaseDaoImpl<Question> implements QuestionDao {

    @Override
    public List<Question> findPage(DetachedCriteria criteria, int currentPage, int pageSize) {
        return (List<Question>) super.getHibernateTemplate().findByCriteria(criteria, (currentPage - 1) * pageSize, pageSize);
    }
}
